package uitl;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DatabaseConnection {
	Connection con;
	
	public DatabaseConnection(){
	try{
			Class.forName("oracle.jdbc.driver.OracleDriver");
			con=DriverManager.getConnection("jdbc:oracle:thin:127.0.0.1:1521:orcl","system","xg123");

		}catch(Exception e1){
			e1.printStackTrace();
		}
}
	public Connection getConnection(){
		return this.con ;
	}
	public void close(){
		if(this.con!=null){
			try {
				this.con.close() ;
			} catch (SQLException e) {				
				e.printStackTrace();
			}
	}
}

	
}